import Vue from 'vue'
import VueRouter from 'vue-router'


// 导入几个路由,文件可以不需要后缀
// 资讯界面的路由文件
import newRoutes from '@/router/routers/NewRoute.js'
// 电影界面的路由文件
import filmRoutes from '@/router/routers/FilmRoute.js'
// 个人中心界面的路由文件
import centerRoutes from '@/router/routers/CenterRoute.js'
// 影院界面的路由文件
import cinemaRoutes from '@/router/routers/CinemaRoute.js'
Vue.use(VueRouter)
// 引入其它几个路由界面的配置，使用扩展运算符
const routes = [
  ...newRoutes,
  ...filmRoutes,
  ...centerRoutes,
  ...cinemaRoutes,
  // 设置根目录跳转
  {
    path: '/',
    redirect:'/film'
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
